//
//  SingerCollectionViewCell.m
//  WXMusic
//
//  Created by 漫步人生路 on 15/9/3.
//  Copyright (c) 2015年 漫步人生路. All rights reserved.
//

#import "SingerCollectionViewCell.h"

@implementation SingerCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.singerImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth / (375 / 80),kWidth / (375 / 80))];
        self.singerName = [[UILabel alloc]initWithFrame:CGRectMake(0, self.singerImage.bounds.size.height, self.bounds.size.width, 30)];
        [self setUpSingerImage:self.singerImage];
        [self setUpSingerName:self.singerName];
        
        [self addSubview:self.singerImage];
        [self addSubview:self.singerName];
        
    }
    return self;
}
- (void)setValueWithModel:(SingerModel *)model
{
    [self.singerImage sd_setImageWithURL:[NSURL URLWithString:model.avatar_middle]];
    self.singerName.text = model.name;
}
- (void)setUpSingerName:(UILabel *)singerName
{
    self.singerName.textAlignment = NSTextAlignmentCenter;
    self.singerName.font = [UIFont boldSystemFontOfSize:14.0];
    self.singerName.textColor = [UIColor whiteColor];

}
- (void)setUpSingerImage:(UIImageView *)singerImage
{
    self.singerImage.layer.masksToBounds = YES;
    self.singerImage.layer.borderColor = [[UIColor whiteColor] CGColor];
    self.singerImage.layer.borderWidth = 2;
    self.singerImage.layer.cornerRadius = self.singerImage.bounds.size.height/2;
}
@end
